import http from "./http";

/**
 * 获取私募动态
 * @param {Object} option
 * @param {Number} option.stockCode - 股票代码
 * @return {Promise} Array
 */
export async function getAddhold(option) {
  const url = "/client/cirholder/addhold";
  const params = {
    stockCode: "",
    ...option,
  };
  const res = await http.get(url, { params });
  return res.data;
}

/**
 * 通过条件查询统计营业部详情-席位掘金 (姚)
 *
 */
export async function getBranch(option) {
  const url = "/client/hero/branch/stat/detail";
  const params = {
    ...option,
  };
  const res = await http.get(url, { params });
  return res.data;
}

/**
 * 查询上榜股票统计详情-个股透视 (姚)
 */
export async function getStock(option) {
  const url =
    "http://gw-test.zx093.com/gw/ynstockinfo/client/hero/stock/stat/detail";
  const params = {
    ...option,
  };
  const res = await http.get(url, { params });
  return res.data;
}

/**
 * 查询上榜股票统计某个交易日营业部上榜数据 (姚)
 */
export async function getBranchList(option) {
  const url =
    "http://gw-test.zx093.com/gw/ynstockinfo/client/hero/stock/stat/branch/list";
  const params = {
    ...option,
  };
  const res = await http.get(url, { params });
  return res.data;
}

/**
 * 最新交易日时间列表 (姚)
 */
export async function getTimeList(option) {
  const url = "http://gw-test.zx093.com/gw/ynstockinfo/client/hero/date/list";
  const params = {
    ...option,
  };
  const res = await http.get(url, { params });
  return res.data;
}

/**
 * 高管增持数据统计
 */
export async function getStockList(option) {
  const url = "/client/manage/stock/list";
  const params = {
    ...option,
  };
  const res = await http.get(url, { params });
  return res.data;
}
